Skip to content

Conversation

@karthage-spartacus
Copy link

Added the possibility to choose a key for sorting with the flag "-k [key]" or "--key [key]"

@kesla
Copy link
Owner

kesla commented Sep 7, 2017

Hey!

Thanks for the pull request.

I have to admit that I'm having troubles understanding exactly what this PR does... Could you perhaps post some example input/out when using the "key"option? Or perhaps even better, add some tests :)

@kesla
Copy link
Owner

kesla commented Sep 7, 2017

Also, if you could rebase on latest master so we can get travis working in this PR that'll be great!

@karthage-spartacus
Copy link
Author

Hi ! well It wasn't very clear indeed...
This PR enables you to choose the key to sort a JSON array. I had an issue with a JSON array which had multiple keys (id int, title string, etc.) and when I used sort-JSON on it, it was sorted by title but I wanted it sorted by id. So I made it up :) . I'll rebase the PR and i'll add some tests in a few days :)

@kingthorin
Copy link

Is this still coming? It's be nice to see, I have a use case where it'd be helpful.

@karthage-spartacus
Copy link
Author

@kingthorin I'll try to push a new PR this weekend if I have the time :)

@hbhaq
Copy link

hbhaq commented Feb 7, 2020

Would be great if you can do it this weekend! i require the same functionality for something im working on!

@kingthorin
Copy link

Any news?

@kingthorin
Copy link

Ping 😊

@karthage-spartacus
Copy link
Author

@kingthorin sorry for the late feedback, I just made a new PR here: #39

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants